package net.xprogrammer;

import org.apache.commons.lang.StringUtils;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String s = StringUtils.repeat(" ", 5);
		System.out.println(s + "length=" + s.length());

	}

	/**
	 * 生成指定个数的空格，用在行的缩进中
	 * 
	 * @param count
	 *            指定空格个数
	 * @return 生成指定个数的空格
	 */
	public static String genSpaces(int count) {
		if (count < 0) {
			throw new IllegalArgumentException("count must be great equal than 0.");
		}
		char[] chs = new char[count];
		for (int i = 0; i < count; i++) {
			chs[i] = ' ';
		}
		return new String(chs);
	}

}
